package com.yqya.hutool.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;

/**
 * 测试示例
 *
 * @author Kevin
 * @date 2019-07-14
 */
@RestController
public class TestController {

    /**
     * 生成全局唯一ID
     */
    @GetMapping("/snowflakeId")
    public Long snowflakeId() {
        Snowflake snowflake = IdUtil.createSnowflake(1, 1);
        long id = snowflake.nextId();
        return id;
    }
}
